/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) Huawei Technologies Co., Ltd. 2024.
* Description: dm functions headers for vims
*/

#ifndef SD_VIMS_H
#define SD_VIMS_H

#include <linux/blkdev.h>

#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_dbg.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_driver.h>
#include <scsi/scsi_eh.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_ioctl.h>
#include <scsi/scsicam.h>

#include "sd.h"

static inline unsigned int sd_vims_min_not_zero(unsigned int sdkp_max_blocks,
				    unsigned int max_blocks)
{
	return min_not_zero(sdkp_max_blocks, max_blocks);
}

#ifdef CONFIG_VIMS_ENHANCE
unsigned int sd_max_ws10_blocks(void);
unsigned int sd_max_ws16_blocks(void);
void vims_report_sd_write_same(struct scsi_disk *sdkp);
#else
static inline unsigned int sd_max_ws10_blocks(void) {return SD_MAX_WS10_BLOCKS; }
static inline unsigned int sd_max_ws16_blocks(void) {return SD_MAX_WS16_BLOCKS; }
static inline void vims_report_sd_write_same(struct scsi_disk *sdkp) { };
#endif /* CONFIG_VIMS_ENHANCE */
#endif /* SD_VIMS_H */
